package fun.zhufn.oldcomm.model.bo;

/**
 * 用户
 */
public class User {
    private String account, pwd, name, birthday, phone;
    private boolean isMale;
    public int permission;

    public User() {
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public boolean isMale() {
        return isMale;
    }

    public void setMale(boolean male) {
        isMale = male;
    }

    public int getPermission() {
        return permission;
    }

    public void setPermission(int permission) {
        this.permission = permission;
    }


    @Override
    public String toString() {
        return "用户：" +
                "账号：" + account + '\n' +
                "姓名：" + name + '\n' +
                "生日：" + birthday + '\n' +
                "电话号码：" + phone + '\n' +
                "性别：" + (isMale ? "男" : "女") + '\n' +
                "身份：" + switch (permission) {
            case 1 -> "后勤管理";
            case 2 -> "生活管家";
            case 3 -> "管理员";
            default -> "未知";

        };
    }

    public User(String account, String pwd, String name, String birthday, String phone, boolean isMale, int permission) {
        this.account = account;
        this.pwd = pwd;
        this.name = name;
        this.birthday = birthday;
        this.phone = phone;
        this.isMale = isMale;
        this.permission = permission;
    }
}
